package ar.com.angrymachine.hunter.gameplay;

import java.awt.Image;

import ar.com.angrymachine.hunter.Game;

public class Monster extends Character implements Cloneable
{
    public String name;
    public Image icon;
    public Treasure treasure = null;
    public int timeToAttack = 0;
    
    public Monster(String name, Image icon, int maxHealth, int attackPower, int attackRate, int level)
    {
    	super(maxHealth, attackPower, attackRate, level);
        this.name = name;
        this.icon = icon;
    }
    
    public Object clone()
    {
        return super.clone();
    }
   
    // returns if it attacks
	public boolean update(int delta)
	{
        timeToAttack += delta;
        if (timeToAttack >= attackRate)
        {
            timeToAttack = 0;
            Game.current.player.receiveAttack(getHitDamage());
            return true;
        }
        return false;
	}
}
